package com.chuantou.yuba.api.to;

import android.os.Parcel;
import android.os.Parcelable;

import com.google.gson.annotations.SerializedName;

/**
 * 礼品实体
 * 
 * @author Administrator
 * 
 */
public class GiftTO implements Parcelable {
	@SerializedName("id")
	private long id;
	// 礼品名称
	@SerializedName("name")
	private String name;
	// 礼品封面
	@SerializedName("cover")
	private String cover;
	// 所需积分
	@SerializedName("score")
	private int cost;
	// 库存
	@SerializedName("stock")
	private int stock;
	// 赞助商
	@SerializedName("sponsor")
	private String sponsor;

	// 兑换截止时间
	@SerializedName("stop_dateline")
	private long time;

	public GiftTO() {
	}

	public GiftTO(Parcel source) {
		this.id = source.readLong();
		this.name = source.readString();
		this.cover = source.readString();
		this.cost = source.readInt();
		this.stock = source.readInt();
		this.sponsor = source.readString();
		this.time = source.readLong();
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeLong(id);
		dest.writeString(name);
		dest.writeString(cover);
		dest.writeInt(cost);
		dest.writeInt(stock);
		dest.writeString(sponsor);
		dest.writeLong(time);
	}

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCover() {
		return cover;
	}

	public void setCover(String cover) {
		this.cover = cover;
	}

	public int getCost() {
		return cost;
	}

	public void setCost(int cost) {
		this.cost = cost;
	}

	public int getStock() {
		return stock;
	}

	public void setStock(int stock) {
		this.stock = stock;
	}

	public String getSponsor() {
		return sponsor;
	}

	public void setSponsor(String sponsor) {
		this.sponsor = sponsor;
	}

	public long getTime() {
		return time;
	}

	public void setTime(long time) {
		this.time = time;
	}

	public static final Creator<GiftTO> CREATOR = new Creator<GiftTO>() {

		@Override
		public GiftTO[] newArray(int size) {
			return new GiftTO[size];
		}

		@Override
		public GiftTO createFromParcel(Parcel source) {
			return new GiftTO(source);
		}
	};

}
